package com.bwda.dsrs.filecenter;

import com.bwda.dsrs.filecenter.quartz.JobLoader;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

/**
 * @author Administrator
 */
@Component
public class SystemInit implements CommandLineRunner {
    private static Logger logger = LoggerFactory.getLogger(SystemInit.class);
    @Autowired
    private JobLoader jobLoader;
    /**
     * 系统启动后的处理
     *
     * @param args 命令行参数
     * @throws Exception
     */
    @Override
    public void run(String... args) throws Exception {

        logger.info("timedTask****************begin***");
        //加载任务表中的定时任务
        jobLoader.loadJobs();
        logger.info("timedTask******************end****");
    }
}
